package com.dr.controller;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import com.dr.pojo.User;
import com.dr.service.HelloService;

@Controller
public class HelloController {
	@Autowired
	private HelloService service;

	@RequestMapping("/hello")
	public ModelAndView hello() {
		List<User> list = service.findUserList();
		ModelAndView mav = new ModelAndView();
		mav.addObject("list", list);
		mav.setViewName("hello");
		return mav;
	}
}
